package com.faxsun.payment.service.gateway;

import org.broadleafcommerce.common.payment.PaymentGatewayType;
import org.springframework.stereotype.Service;

import com.faxsun.payment.vendor.paysss.service.PaySSSPaymentGatewayType;

@Service("fsPaySSSHostedConfiguration")
public class PaySSSHostedConfiguration implements PaymentGatewayHostedConfiguration {

	protected int failureReportingThreshold = 1;

	protected boolean performAuthorizeAndCapture = true;

	// protected boolean completeCheckoutOnCallBack = true;

	@Override
	public String getHostedRedirectUrl() {
		return "/paysss/hosted/checkout";
	}

	@Override
	public String getHostedRedirectReturnUrl() {
		return "/paysss/hosted/return";
	}

	@Override
	public boolean isPerformAuthorizeAndCapture() {
		return performAuthorizeAndCapture;
	}

	@Override
	public void setPerformAuthorizeAndCapture(boolean performAuthorizeAndCapture) {
		this.performAuthorizeAndCapture = performAuthorizeAndCapture;
	}

	@Override
	public int getFailureReportingThreshold() {
		return failureReportingThreshold;
	}

	@Override
	public void setFailureReportingThreshold(int failureReportingThreshold) {
		this.failureReportingThreshold = failureReportingThreshold;
	}

	@Override
	public boolean handlesAuthorize() {
		return false;
	}

	@Override
	public boolean handlesCapture() {
		return false;
	}

	@Override
	public boolean handlesAuthorizeAndCapture() {
		return true;
	}

	@Override
	public boolean handlesReverseAuthorize() {
		return false;
	}

	@Override
	public boolean handlesVoid() {
		return false;
	}

	@Override
	public boolean handlesRefund() {
		return true;
	}

	@Override
	public boolean handlesPartialCapture() {
		return false;
	}

	@Override
	public boolean handlesMultipleShipment() {
		return false;
	}

	@Override
	public boolean handlesRecurringPayment() {
		return false;
	}

	@Override
	public boolean handlesSavedCustomerPayment() {
		return false;
	}

	@Override
	public boolean handlesMultiplePayments() {
		return false;
	}

	@Override
	public PaymentGatewayType getGatewayType() {
		return PaySSSPaymentGatewayType.PAYSSS_HOSTED_GATEWAY;
	}

	// public boolean isCompleteCheckoutOnCallBack() {
	// return completeCheckoutOnCallBack;
	// }
	//
	// public void setCompleteCheckoutOnCallBack(boolean
	// completeCheckoutOnCallBack) {
	// this.completeCheckoutOnCallBack = completeCheckoutOnCallBack;
	//
	// }

}
